home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / DOCVIEW.PAK / DUMPVIEW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.3 KB  |  77 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1993, 1995 by Borland International, All Rights Reserved
  4. //
  5. //   Definition of class TDumpView
  6. //----------------------------------------------------------------------------
  7. #if !defined(OWL_DUMPVIEW_H)
  8. #define OWL_DUMPVIEW_H
  9.  
  10. #if !defined(OWL_DOCVIEW_H)
  11. # include <owl/docview.h>
  12. #endif
  13. #if !defined(OWL_LISTBOXW_H)
  14. # include <owl/listbox.h>
  15. #endif
  16.  
  17. struct TDumpData;
  18.  
  19. class _DOCVIEWCLASS TDumpView : public TListBox, public TView {
  20.   public:
  21.     TDumpView(TDocument& doc, TWindow* parent = 0);
  22.    ~TDumpView();
  23.     static const char far* StaticName() {return "Dump View";}
  24.  
  25.     // Overridden virtuals from TView
  26.     //
  27.     const char far*   GetViewName(){return StaticName();}
  28.     TWindow* GetWindow()  {return (TWindow*)this;}
  29.     bool     SetDocTitle(const char far* docname, int index)
  30.                           {return TListBox::SetDocTitle(docname, index);}
  31.  
  32.     // Overridden virtuals from TWindow
  33.     //
  34.     bool     Create();
  35.     bool     CanClose()   {return TListBox::CanClose() && Doc->CanClose();}
  36.  
  37.     int      MaxWidth;    // maximum horizontal extent
  38.  
  39.   protected:
  40.     void Init();
  41.     bool LoadData(int top, int sel);
  42.     void FormatLine(int index, TDumpData* data);
  43.     bool NewEditLine(int line, int byte);
  44.     void EndEditLine();
  45.     void KillChanges();
  46.  
  47.     long Origin;
  48.     long FileSize;
  49.     int  UpdateMode; // 0=NotEditing, 1=HighNibble, 2=LowNibble, -1=Flushing
  50.     int  CharWidth;
  51.     int  CharHeight;
  52.     int  EditByte;
  53.     int  EditLine;
  54.     TDumpData* Changes;
  55.  
  56.   private:
  57.     // Message response functions
  58.     //
  59.     bool VnCommit(bool force);
  60.     bool VnRevert(bool clear);
  61.     bool VnIsWindow(HWND hWnd) {return HWindow == hWnd;}
  62.     bool VnIsDirty();
  63.     bool VnDocClosed(int omode);
  64.     void CmEditUndo();
  65.     void CmEditItem();
  66.     void EvPaint();
  67.     void EvKeyDown(uint key, uint repeatCount, uint flags);
  68.     void EvLButtonDown(uint modKeys, TPoint& point);
  69.     void EvLButtonDblClk(uint modKeys, TPoint& point);
  70.     void CmSelChange() {} // to prevent interpreting as unprocessed accelerator
  71.  
  72.   DECLARE_RESPONSE_TABLE(TDumpView);
  73.   DECLARE_STREAMABLE(,TDumpView,1);
  74. };
  75.  
  76. #endif  // OWL_DUMPVIEW_H
  77.